Laro.register('VHome.$loop', function (La) {
    var pkg = this;

    this.init = function () {
        this.$ = new La.Loop(this.looper, this);
    }

    this.looper = function (dt) {
        this.update(dt);
        this.draw();
    }
    this.update = function (dt) {
        VHome.$fsm.$.update(dt);
        if (VHome.zstep > 2 || VHome.zstep < -2) {
            VHome.zflag *= -1;
        }
        VHome.zstep += VHome.zflag*0.01;
        //VHome.updateNormalBalls(dt);
    }
    this.draw = function () {
        VHome.ctx.clearRect(0, 0, VHome.canvas.width, VHome.canvas.height);
        VHome.stage.render();
        VHome.$fsm.$.draw();
    }
});
